<%@ page contentType="text/html; charset=UTF-8" %>
<%@ page import="com.savvion.BizSolo.Server.*,com.savvion.BizSolo.beans.*,java.util.Vector,com.savvion.sbm.bizlogic.server.svo.DocumentDS,com.savvion.sbm.dms.svo.Document,java.util.List" %>
<%@ page errorPage="/BizSolo/common/jsp/error.jsp" %>
<%@ taglib uri="/BizSolo/common/tlds/bizsolo.tld" prefix="bizsolo" %>
<%@ taglib uri="/bpmportal/tld/bpmportal.tld" prefix="sbm" %>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %>
<%@ taglib prefix="sfe" uri="http://jmaki/v1.0/jsp" %>
  <jsp:useBean id="bizManage" class="com.savvion.sbm.bizmanage.api.BizManageBean" scope="session"></jsp:useBean>
  <jsp:useBean id="bean" class="com.savvion.BizSolo.beans.Bean" scope="session"></jsp:useBean>
  <jsp:useBean id="factoryBean" class="com.savvion.BizSolo.beans.EPFactoryBean" scope="session"></jsp:useBean>
  <jsp:useBean id="bizSite" class="com.savvion.sbm.bpmportal.bizsite.api.BizSiteBean" scope="session"></jsp:useBean>
<%! String _PageName = "showDocument"; %>
<%! String __webAppName = "PerformAssignment"; %>
<% pageContext.setAttribute( "contextPath", request.getContextPath()+"/"); %>
<%
String dsName = request.getParameter("dsName");

com.savvion.BizSolo.beans.DocLocator docLocator = (com.savvion.BizSolo.beans.DocLocator) bean.getPropObject(dsName);
DocumentDS completedAssignment = docLocator.getDocumentDS(); 
List<Document> docs = completedAssignment.getDocuments();
Document doc = docs.get(0);
System.out.println(doc.getPhysicalLocation());
System.out.println(doc.getId());
System.out.println(doc.getName());
System.out.println(doc.getPath());
byte[] bites = completedAssignment.getContent(doc.getName());
response.setContentType("application/pdf");
response.setContentLength(bites.length);
ServletOutputStream ouputStream = response.getOutputStream();
ouputStream.write(bites);
ouputStream.flush();
ouputStream.close();

%>